package com.dxjy.demo.module.sys.redis;

import lombok.Getter;

@Getter
public enum RedisKeyEnum {

    PLATFORMINFO("platform", "平台相关", 1000 * 60 * 60 * 24), // 24H

    CAPTCHA("captcha", "验证码", 1000 * 60 * 2); // 2min


    private String key;
    private String desc;
    private long time; // 毫秒

    RedisKeyEnum(String key, String desc, long time) {
        this.key = key;
        this.desc = desc;
        this.time = time;
    }

    public String getKey(String suffix) {
        return String.format("%s:%s:%s", "sys", key, suffix);
    }

}
